package com.da.javatest.leetCode;

/**
 * @author chenlida
 * @date 2019/2/15 17:39
 * @description
 */
public class Code125 {
    public static void main(String[] args) {
        System.out.println(new Code125().isPalindrome("0P"));
    }

    public boolean isPalindrome(String s) {
        s = s.toLowerCase();
        StringBuilder sb = new StringBuilder();
        for (char c : s.toCharArray()) {
            if ((c > 96 && c < 123) || (c > 47 && c < 58)) {
                sb.append(c);
            }
        }
        return sb.toString().equals(sb.reverse().toString());
    }
}
